package org.csmzxy.class2333;

public class 公约数公倍数 {
    public static int min_gong(int a,int b){
        for(int i = Math.max(a,b);;i++){
            if (i%a==0 && i%b == 0){
                return i;
            }
        }
    }
    public static int max_yue(int a,int b){
        while(true){
            a = a%b;
            if (a == 0){
                return b;
            }
            b = b%a;
            if (b == 0){
                return a;
            }
        }
    }

    public static void main (String[] args){
        System.out.println(min_gong(4,5));
        System.out.println(max_yue(4,8));
    }
}
